<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/blog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/blog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/blog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/blog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/blog/css/main.css">


<link rel="stylesheet" href="/blog/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"dnxbjyj.gitee.io","root":"/blog/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","width":320,"display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":true,"show_result":true,"style":"mac"},"back2top":{"enable":true,"sidebar":true,"scrollpercent":true},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":true},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="安装nodejs下载http:&#x2F;&#x2F;nodejs.cn&#x2F;download&#x2F; 安装下载安装包进行安装。">
<meta property="og:type" content="article">
<meta property="og:title" content="Hexo博客从0到1">
<meta property="og:url" content="https://dnxbjyj.gitee.io/blog/posts/Blog-Meta/20211019-hexo-from-0-to-1.html">
<meta property="og:site_name" content="MindCons">
<meta property="og:description" content="安装nodejs下载http:&#x2F;&#x2F;nodejs.cn&#x2F;download&#x2F; 安装下载安装包进行安装。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-10-18T16:11:47.000Z">
<meta property="article:modified_time" content="2021-11-07T13:19:29.400Z">
<meta property="article:author" content="m2fox">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://dnxbjyj.gitee.io/blog/posts/Blog-Meta/20211019-hexo-from-0-to-1.html">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Hexo博客从0到1 | MindCons</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/blog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">MindCons</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/blog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/blog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/blog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/blog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/blog/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://dnxbjyj.gitee.io/blog/posts/Blog-Meta/20211019-hexo-from-0-to-1.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/blog/images/avatar.gif">
      <meta itemprop="name" content="m2fox">
      <meta itemprop="description" content="">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="MindCons">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Hexo博客从0到1
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-10-19 00:11:47" itemprop="dateCreated datePublished" datetime="2021-10-19T00:11:47+08:00">2021-10-19</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-11-07 21:19:29" itemprop="dateModified" datetime="2021-11-07T21:19:29+08:00">2021-11-07</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/blog/categories/Blog-Meta/" itemprop="url" rel="index"><span itemprop="name">Blog Meta</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="安装nodejs"><a href="#安装nodejs" class="headerlink" title="安装nodejs"></a>安装nodejs</h1><h2 id="下载"><a href="#下载" class="headerlink" title="下载"></a>下载</h2><p><a target="_blank" rel="noopener" href="http://nodejs.cn/download/">http://nodejs.cn/download/</a></p>
<h2 id="安装"><a href="#安装" class="headerlink" title="安装"></a>安装</h2><p>下载安装包进行安装。</p>
<span id="more"></span>

<h2 id="配置淘宝npm源"><a href="#配置淘宝npm源" class="headerlink" title="配置淘宝npm源"></a>配置淘宝npm源</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm config <span class="built_in">set</span> registry https://registry.npm.taobao.org/</span><br></pre></td></tr></table></figure>

<h2 id="查看源"><a href="#查看源" class="headerlink" title="查看源"></a>查看源</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm config get registry</span><br></pre></td></tr></table></figure>

<h1 id="创建hexo博客"><a href="#创建hexo博客" class="headerlink" title="创建hexo博客"></a>创建hexo博客</h1><h2 id="创建hexo博客仓库"><a href="#创建hexo博客仓库" class="headerlink" title="创建hexo博客仓库"></a>创建hexo博客仓库</h2><h3 id="前提"><a href="#前提" class="headerlink" title="前提"></a>前提</h3><p>安装好nodejs和git。</p>
<h3 id="使用npm安装hexo"><a href="#使用npm安装hexo" class="headerlink" title="使用npm安装hexo"></a>使用npm安装hexo</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-cli -g</span><br></pre></td></tr></table></figure>

<h3 id="初始化hexo博客仓库"><a href="#初始化hexo博客仓库" class="headerlink" title="初始化hexo博客仓库"></a>初始化hexo博客仓库</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo init blog</span><br><span class="line"><span class="built_in">cd</span> blog</span><br><span class="line">npm install</span><br></pre></td></tr></table></figure>

<h2 id="hexo博客创作、预览和发布"><a href="#hexo博客创作、预览和发布" class="headerlink" title="hexo博客创作、预览和发布"></a>hexo博客创作、预览和发布</h2><h3 id="创建一篇新的文章"><a href="#创建一篇新的文章" class="headerlink" title="创建一篇新的文章"></a>创建一篇新的文章</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo new hi-hexo</span><br></pre></td></tr></table></figure>

<p>这时在hexo博客的<code>_posts</code>目录（比如：<code>/Users/m2fox/hack/blog/source/_posts</code>）就会出现一个新的名为<code>hi-hexo.md</code>的文件，可以在里面编辑博客文章内容，其默认内容如下：</p>
<figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: hi-hexo</span><br><span class="line">date: 2021-10-18 23:59:07</span><br><span class="line"><span class="section">tags:</span></span><br><span class="line"><span class="section">---</span></span><br></pre></td></tr></table></figure>

<p>这是hexo博客文章的默认开头，第一行<code>title</code>表示标题，第二行表示创建时间，第三行表示标签，开头的下方可以写博客正文。</p>
<p>修改<code>hi-hexo.md</code>文件的内容如下：</p>
<figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 你好，Hexo！</span><br><span class="line">date: 2021-10-18 23:59:07</span><br><span class="line">tags:</span><br><span class="line"><span class="bullet">-</span> hi</span><br><span class="line"><span class="section">- hexo</span></span><br><span class="line"><span class="section">---</span></span><br><span class="line"></span><br><span class="line">从0到1入坑Hexo!</span><br></pre></td></tr></table></figure>

<h3 id="生成网页文件"><a href="#生成网页文件" class="headerlink" title="生成网页文件"></a>生成网页文件</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo generate</span><br><span class="line"><span class="comment"># 或简写：hexo g</span></span><br></pre></td></tr></table></figure>

<h3 id="本地启动hexo博客"><a href="#本地启动hexo博客" class="headerlink" title="本地启动hexo博客"></a>本地启动hexo博客</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">hexo server</span><br><span class="line"><span class="comment"># 或简写：hexo s</span></span><br><span class="line"><span class="comment"># 默认不显示草稿文章，如果要显示草稿：hexo s --drafts</span></span><br></pre></td></tr></table></figure>

<p>本地启动之后，在浏览器博客首页（默认地址为：<code>http://localhost:4000</code>）就能看到名为<code>你好，Hexo！</code>的博客文章了！</p>
<h3 id="发布到远程托管平台"><a href="#发布到远程托管平台" class="headerlink" title="发布到远程托管平台"></a>发布到远程托管平台</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">hexo deploy</span><br><span class="line"><span class="comment"># 或简写：hexo d</span></span><br></pre></td></tr></table></figure>

<h1 id="发布博客"><a href="#发布博客" class="headerlink" title="发布博客"></a>发布博客</h1><h2 id="pages托管平台准备"><a href="#pages托管平台准备" class="headerlink" title="pages托管平台准备"></a>pages托管平台准备</h2><p>以gitee pages为例<br>创建一个普通的仓库 blog<br>开通pages服务（需进行实名认证审核）<br>把本地通过hexo命令创建的仓库（需要git init初始化）关联上blog仓库，<code>hexo clean; hexo g;</code>，<code>git add -A; git commit -m &quot;hexo update&quot;; git push origin master</code><br>在gitee pages服务页面，设置部署目录为<code>public</code>，点<code>更新</code>按钮，更新之后即可通过<code>https://dnxbjyj.gitee.io/blog</code>网址访问博客。以后每次push代码后，都要点pages服务页面的<code>更新</code>按钮更新博客。</p>
<h1 id="博客配置"><a href="#博客配置" class="headerlink" title="博客配置"></a>博客配置</h1><p>注：以下的配置都是基于next主题、gitee pages仓库。</p>
<h2 id="配置next主题"><a href="#配置next主题" class="headerlink" title="配置next主题"></a>配置next主题</h2><p>下载next，themes/<br>_config.yml</p>
<h2 id="基础配置"><a href="#基础配置" class="headerlink" title="基础配置"></a>基础配置</h2><h3 id="博客元数据"><a href="#博客元数据" class="headerlink" title="博客元数据"></a>博客元数据</h3><ul>
<li>博客标题：<code>_config.yml#title</code></li>
<li>博客作者：<code>_config.yml#author</code></li>
<li>博客语言设置为中文（默认为英文）：<code>_config.yml#language: zh-CN</code></li>
<li>设置博客的草稿、博文的模板：<code>scaffolds/draft.md</code>, <code>scaffolds/post.md</code></li>
</ul>
<h3 id="next主题配置"><a href="#next主题配置" class="headerlink" title="next主题配置"></a>next主题配置</h3><ul>
<li>查看next包版本号：<code>themes/next/package.json#version</code></li>
<li>设置主题风格：<code>themes/next/_config.yml#scheme</code></li>
<li>设置侧边栏宽度：<code>themes/next/_config.yml#sidebar.width</code></li>
<li>代码块配置（语法高亮主题、复制按钮、代码块风格）：<code>themes/next/_config.yml#codeblock</code></li>
<li>侧栏回到顶部、显示侧栏阅读进度百分比：<code>themes/next/_config.yml#back2top</code></li>
<li>设置侧边栏目录自动换行：<code>themes/next/_config.yml#toc.wrap</code></li>
<li>设置首页菜单：<code>themes/next/_config.yml#menu</code></li>
<li>设置文章底部和侧边栏底部的版权声明：<code>themes/next/_config.yml#creative_commons</code>，中文语言为：<code>language: deed.zh-Hans</code></li>
</ul>
<h2 id="进阶配置"><a href="#进阶配置" class="headerlink" title="进阶配置"></a>进阶配置</h2><h3 id="为一篇文章配置多个和多级的分类"><a href="#为一篇文章配置多个和多级的分类" class="headerlink" title="为一篇文章配置多个和多级的分类"></a>为一篇文章配置多个和多级的分类</h3><figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">categories:</span><br><span class="line"><span class="bullet">  -</span> [思维导图笔记, Elisp]</span><br><span class="line"><span class="bullet">  -</span> [Emacs Lisp, 基本语法]</span><br><span class="line"><span class="bullet">  -</span> [视觉记忆]</span><br></pre></td></tr></table></figure>
<p>如上面的配置，该篇文章将会同时属于<code>思维导图笔记</code>、<code>Emacs Lisp</code>和<code>视觉记忆</code>三个独立的一级分类，同时属于<code>Elisp</code>、<code>基本语法</code>两个二级子分类。</p>
<p>注：为了突出子目录的层次感，可以将<code>themes/next/source/css/_common/components/pages/categories.styl#.category-list-child</code>的<code>padding-left</code>值改为60px（默认为10px）。</p>
<h3 id="首页文章列表显示”阅读全文”"><a href="#首页文章列表显示”阅读全文”" class="headerlink" title="首页文章列表显示”阅读全文”"></a>首页文章列表显示”阅读全文”</h3><p>比较灵活的方式：在文章正文任意位置插入<code>&lt;!-- more --&gt;</code>，即可实现灵活的截断。</p>
<h3 id="TODO-配置博文URL"><a href="#TODO-配置博文URL" class="headerlink" title="TODO 配置博文URL"></a>TODO 配置博文URL</h3><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/yanzi1225627/article/details/77761488">https://blog.csdn.net/yanzi1225627/article/details/77761488</a></p>
<h3 id="TODO-配置图片资源目录"><a href="#TODO-配置图片资源目录" class="headerlink" title="TODO 配置图片资源目录"></a>TODO 配置图片资源目录</h3><p><a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_38148394/article/details/79997971">https://blog.csdn.net/qq_38148394/article/details/79997971</a></p>
<p>node_modules/hexo-asset-image/index.js<br><code>$(this).attr(&#39;src&#39;, config.root + link + src);</code>改为：<br><code>$(this).attr(&#39;src&#39;, &quot;/&quot; + link + src);</code><br>注：可在js代码中用<code>console.log</code>打日志，本地hexo启动时候在命令行会把日志打出来，有助于定位问题。</p>
<h3 id="添加全文搜索插件"><a href="#添加全文搜索插件" class="headerlink" title="添加全文搜索插件"></a>添加全文搜索插件</h3><ul>
<li>在博客根目录安装<code>hexo-generator-searchdb</code>插件：</li>
</ul>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-searchdb --save</span><br></pre></td></tr></table></figure>

<ul>
<li>修改博客配置文件<code>_config.yml</code>添加search配置：</li>
</ul>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="attr">search:</span></span><br><span class="line">  <span class="attr">path:</span> <span class="string">search.xml</span></span><br><span class="line">  <span class="attr">field:</span> <span class="string">post</span></span><br><span class="line">  <span class="attr">format:</span> <span class="string">html</span></span><br><span class="line">  <span class="attr">limit:</span> <span class="number">10000</span></span><br></pre></td></tr></table></figure>

<ul>
<li>修改next主题配置文件，打开local_search：</li>
</ul>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">local_search:</span><br><span class="line">  enable: true</span><br></pre></td></tr></table></figure>

<p>本地重新启动hexo服务即可生效。</p>
<h1 id="常见问题"><a href="#常见问题" class="headerlink" title="常见问题"></a>常见问题</h1><h2 id="分类和标签页面404"><a href="#分类和标签页面404" class="headerlink" title="分类和标签页面404"></a>分类和标签页面404</h2><ul>
<li>原因：主题和标签index.md文件没有创建导致的。</li>
<li>解决方案（以配置分类页面为例，标签页面同理）：<ul>
<li>先要打开菜单：<code>themes/next/_config.yml#menu</code></li>
<li><code>hexo n page categories</code></li>
<li>这时会出现一个文件：<code>source/categories/index.md</code>，修改其内容为：<figure class="highlight md"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 分类</span><br><span class="line">date: 2020-03-04 17:18:32</span><br><span class="line">type: categories</span><br><span class="line"><span class="section">layout: categories   #注意此行不添加则点击不会显示分类结果</span></span><br><span class="line"><span class="section">---</span></span><br></pre></td></tr></table></figure></li>
</ul>
</li>
</ul>
<h2 id="next主题侧边栏的目录错乱"><a href="#next主题侧边栏的目录错乱" class="headerlink" title="next主题侧边栏的目录错乱"></a>next主题侧边栏的目录错乱</h2><ul>
<li>原因：markdown中使用的标题层级发生了跳跃，比如一级标题下面直接紧跟着三级标题。</li>
<li>解决方法：标题层级不要跳跃。</li>
</ul>
<h1 id="参考"><a href="#参考" class="headerlink" title="参考"></a>参考</h1><h2 id="Hexo"><a href="#Hexo" class="headerlink" title="Hexo"></a>Hexo</h2><ul>
<li><a target="_blank" rel="noopener" href="https://www.zhihu.com/column/p/26625249">GitHub+Hexo 搭建个人网站详细教程</a></li>
<li><a target="_blank" rel="noopener" href="https://hexo.io/docs/writing.html">Writing</a></li>
<li><a target="_blank" rel="noopener" href="https://hexo.io/docs/server.html">Server</a></li>
<li><a target="_blank" rel="noopener" href="https://hexo.io/docs/generating.html">Generating</a></li>
<li><a target="_blank" rel="noopener" href="https://hexo.io/docs/one-command-deployment.html">Deployment</a></li>
</ul>
<h2 id="next主题"><a href="#next主题" class="headerlink" title="next主题"></a>next主题</h2><ul>
<li><a target="_blank" rel="noopener" href="https://www.techgrow.cn/posts/755ff30d.html">Hexo Next 主题详细配置之一</a></li>
</ul>

    </div>

    
    
    
        

<div>
<ul class="post-copyright">
  <li class="post-copyright-author">
    <strong>本文作者： </strong>m2fox
  </li>
  <li class="post-copyright-link">
    <strong>本文链接：</strong>
    <a href="https://dnxbjyj.gitee.io/blog/posts/Blog-Meta/20211019-hexo-from-0-to-1.html" title="Hexo博客从0到1">https://dnxbjyj.gitee.io/blog/posts/Blog-Meta/20211019-hexo-from-0-to-1.html</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-Hans" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>


      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/blog/posts/%E6%80%9D%E7%BB%B4%E5%AF%BC%E5%9B%BE%E7%AC%94%E8%AE%B0/%E6%8A%80%E6%9C%AF/20211020-elisp-advice.html" rel="next" title="Elisp advice机制">
      Elisp advice机制 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%AE%89%E8%A3%85nodejs"><span class="nav-number">1.</span> <span class="nav-text">安装nodejs</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E4%B8%8B%E8%BD%BD"><span class="nav-number">1.1.</span> <span class="nav-text">下载</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%AE%89%E8%A3%85"><span class="nav-number">1.2.</span> <span class="nav-text">安装</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE%E6%B7%98%E5%AE%9Dnpm%E6%BA%90"><span class="nav-number">1.3.</span> <span class="nav-text">配置淘宝npm源</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9F%A5%E7%9C%8B%E6%BA%90"><span class="nav-number">1.4.</span> <span class="nav-text">查看源</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%88%9B%E5%BB%BAhexo%E5%8D%9A%E5%AE%A2"><span class="nav-number">2.</span> <span class="nav-text">创建hexo博客</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%88%9B%E5%BB%BAhexo%E5%8D%9A%E5%AE%A2%E4%BB%93%E5%BA%93"><span class="nav-number">2.1.</span> <span class="nav-text">创建hexo博客仓库</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%89%8D%E6%8F%90"><span class="nav-number">2.1.1.</span> <span class="nav-text">前提</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BD%BF%E7%94%A8npm%E5%AE%89%E8%A3%85hexo"><span class="nav-number">2.1.2.</span> <span class="nav-text">使用npm安装hexo</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%9D%E5%A7%8B%E5%8C%96hexo%E5%8D%9A%E5%AE%A2%E4%BB%93%E5%BA%93"><span class="nav-number">2.1.3.</span> <span class="nav-text">初始化hexo博客仓库</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#hexo%E5%8D%9A%E5%AE%A2%E5%88%9B%E4%BD%9C%E3%80%81%E9%A2%84%E8%A7%88%E5%92%8C%E5%8F%91%E5%B8%83"><span class="nav-number">2.2.</span> <span class="nav-text">hexo博客创作、预览和发布</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E4%B8%80%E7%AF%87%E6%96%B0%E7%9A%84%E6%96%87%E7%AB%A0"><span class="nav-number">2.2.1.</span> <span class="nav-text">创建一篇新的文章</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%94%9F%E6%88%90%E7%BD%91%E9%A1%B5%E6%96%87%E4%BB%B6"><span class="nav-number">2.2.2.</span> <span class="nav-text">生成网页文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9C%AC%E5%9C%B0%E5%90%AF%E5%8A%A8hexo%E5%8D%9A%E5%AE%A2"><span class="nav-number">2.2.3.</span> <span class="nav-text">本地启动hexo博客</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8F%91%E5%B8%83%E5%88%B0%E8%BF%9C%E7%A8%8B%E6%89%98%E7%AE%A1%E5%B9%B3%E5%8F%B0"><span class="nav-number">2.2.4.</span> <span class="nav-text">发布到远程托管平台</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%8F%91%E5%B8%83%E5%8D%9A%E5%AE%A2"><span class="nav-number">3.</span> <span class="nav-text">发布博客</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#pages%E6%89%98%E7%AE%A1%E5%B9%B3%E5%8F%B0%E5%87%86%E5%A4%87"><span class="nav-number">3.1.</span> <span class="nav-text">pages托管平台准备</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%8D%9A%E5%AE%A2%E9%85%8D%E7%BD%AE"><span class="nav-number">4.</span> <span class="nav-text">博客配置</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%85%8D%E7%BD%AEnext%E4%B8%BB%E9%A2%98"><span class="nav-number">4.1.</span> <span class="nav-text">配置next主题</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9F%BA%E7%A1%80%E9%85%8D%E7%BD%AE"><span class="nav-number">4.2.</span> <span class="nav-text">基础配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8D%9A%E5%AE%A2%E5%85%83%E6%95%B0%E6%8D%AE"><span class="nav-number">4.2.1.</span> <span class="nav-text">博客元数据</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#next%E4%B8%BB%E9%A2%98%E9%85%8D%E7%BD%AE"><span class="nav-number">4.2.2.</span> <span class="nav-text">next主题配置</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E8%BF%9B%E9%98%B6%E9%85%8D%E7%BD%AE"><span class="nav-number">4.3.</span> <span class="nav-text">进阶配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%BA%E4%B8%80%E7%AF%87%E6%96%87%E7%AB%A0%E9%85%8D%E7%BD%AE%E5%A4%9A%E4%B8%AA%E5%92%8C%E5%A4%9A%E7%BA%A7%E7%9A%84%E5%88%86%E7%B1%BB"><span class="nav-number">4.3.1.</span> <span class="nav-text">为一篇文章配置多个和多级的分类</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%A6%96%E9%A1%B5%E6%96%87%E7%AB%A0%E5%88%97%E8%A1%A8%E6%98%BE%E7%A4%BA%E2%80%9D%E9%98%85%E8%AF%BB%E5%85%A8%E6%96%87%E2%80%9D"><span class="nav-number">4.3.2.</span> <span class="nav-text">首页文章列表显示”阅读全文”</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#TODO-%E9%85%8D%E7%BD%AE%E5%8D%9A%E6%96%87URL"><span class="nav-number">4.3.3.</span> <span class="nav-text">TODO 配置博文URL</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#TODO-%E9%85%8D%E7%BD%AE%E5%9B%BE%E7%89%87%E8%B5%84%E6%BA%90%E7%9B%AE%E5%BD%95"><span class="nav-number">4.3.4.</span> <span class="nav-text">TODO 配置图片资源目录</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B7%BB%E5%8A%A0%E5%85%A8%E6%96%87%E6%90%9C%E7%B4%A2%E6%8F%92%E4%BB%B6"><span class="nav-number">4.3.5.</span> <span class="nav-text">添加全文搜索插件</span></a></li></ol></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98"><span class="nav-number">5.</span> <span class="nav-text">常见问题</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%88%86%E7%B1%BB%E5%92%8C%E6%A0%87%E7%AD%BE%E9%A1%B5%E9%9D%A2404"><span class="nav-number">5.1.</span> <span class="nav-text">分类和标签页面404</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#next%E4%B8%BB%E9%A2%98%E4%BE%A7%E8%BE%B9%E6%A0%8F%E7%9A%84%E7%9B%AE%E5%BD%95%E9%94%99%E4%B9%B1"><span class="nav-number">5.2.</span> <span class="nav-text">next主题侧边栏的目录错乱</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#%E5%8F%82%E8%80%83"><span class="nav-number">6.</span> <span class="nav-text">参考</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#Hexo"><span class="nav-number">6.1.</span> <span class="nav-text">Hexo</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#next%E4%B8%BB%E9%A2%98"><span class="nav-number">6.2.</span> <span class="nav-text">next主题</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">m2fox</p>
  <div class="site-description" itemprop="description"></div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/blog/archives/">
        
          <span class="site-state-item-count">12</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/blog/categories/">
          
        <span class="site-state-item-count">12</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
  </nav>
</div>
  <div class="cc-license motion-element" itemprop="license">
    <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh-Hans" class="cc-opacity" rel="noopener" target="_blank"><img src="/blog/images/cc-by-nc-sa.svg" alt="Creative Commons"></a>
  </div>



      </div>
        <div class="back-to-top motion-element">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">m2fox</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://pisces.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> 强力驱动
  </div>

        








      </div>
    </footer>
  </div>

  
  <script src="/blog/lib/anime.min.js"></script>
  <script src="/blog/lib/velocity/velocity.min.js"></script>
  <script src="/blog/lib/velocity/velocity.ui.min.js"></script>

<script src="/blog/js/utils.js"></script>

<script src="/blog/js/motion.js"></script>


<script src="/blog/js/schemes/pisces.js"></script>


<script src="/blog/js/next-boot.js"></script>




  




  
<script src="/blog/js/local-search.js"></script>













  

  

</body>
</html>
